<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.io.BufferedReader;" %>
<%@page import="java.io.FileNotFoundException;" %>
<%@page import="java.io.FileReader;" %>
<%@page import="java.util.logging.Logger;" %>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!-- javascript at the bottom for fast page loading -->
<%@ include file="/WEB-INF/jspf/jsDefault.jspf" %>
<f:view>
    <html>

        <head>
            <%@ include file="/WEB-INF/jspf/header.jspf" %>
        </head>

        <body>
            <%@ include file="/WEB-INF/jspf/controlloStudente.jspf" %>
            <div id="main">
                <header>
                    <div id="logo">
                        <%@ include file="/WEB-INF/jspf/logoContent.jspf" %>
                    </div>
                    <nav id="barraMenu">
                        <div id="menu_container">
                            <ul class="sf-menu" id="nav">
                                <h:form>
                                    <%@ include file="/WEB-INF/jspf/menu/studente.jspf" %>
                                </h:form>

                            </ul>
                        </div>
                    </nav>
                </header>
                <div id="site_content">
                    <div id="sidebar_container">
                        <%@ include file="/WEB-INF/jspf/loggedForm.jspf" %>
                    </div>
                    <h:form><h:commandButton value="Indietro" action="GesArticoliStudente.jsp" styleClass="ui-button ui-widget ui-state-default"/></h:form>
                        <div class="content">
                            <p>
                            <%
                                String link = request.getParameter("page");
                                String articolo;
                                StringBuffer sb = new StringBuffer();
                                try {
                                    BufferedReader br = null;
                                    br = new BufferedReader(new FileReader(link));
                                    while (true) {
                                        String l = br.readLine();
                                        if (l == null) {
                                            break;
                                        }
                                        sb.append(l);
                                    }
                                    br.close();
                                } catch (Exception ex) {
                                    articolo = "<h3> Errore durante l'apertura dell'articolo </h3>";
                                }
                                articolo = sb.toString();
                            %>
                            <%= articolo%>
                    </div>
                </div>
                <footer>
                    <p>Copyright &copy; FF-RL 2014</p>
                </footer>
            </div>
            <p>&nbsp;</p>
            <%@ include file="/WEB-INF/jspf/menu/scriptAnimazioneMenu.jspf" %>
            <%@ include file="/WEB-INF/jspf/about/contatti.jspf" %>
        </body>
    </html>
</f:view>